/**
 * 
 */
package com.demo2do.strawberry.entity.startup.fund;

/**
 * @author lute
 *
 */
public enum Weight {
	
	DEFAULT(10, FundStatus.DEFAULT),
	
	LATEST(100, FundStatus.LATEST),
	
	PREFUNDING(1000, FundStatus.PREFUNDING),
	
	FUNDING(10000, FundStatus.FUNDING);
	
	private int weight;
	
	private FundStatus fundStatus;
	
	private Weight(int weight, FundStatus fundStatus) {
		this.weight = weight;
		this.fundStatus = fundStatus;
	}
	
	/**
	 * @return the weight
	 */
	public int getWeight() {
		return weight;
	}
	
	/**
	 * @return the fundStatus
	 */
	public FundStatus getFundStatus() {
		return fundStatus;
	}
	
	public static Weight aliasOf(FundStatus fundStatus) {
		for(Weight weight : Weight.values()) {
			if(weight.getFundStatus().getAlias().equals(fundStatus.getAlias())) {
				return weight;
			}
		}
		return null;
	}

}
